# Framework imports
import os, cgi
from random import *
from google.appengine.api import users
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app

class Menu(object):
  def __init__(self):
    object.__init__(self)
    self.lastpos = 20; self.parity = "up"; self.step = 80

  # Helper function that creates menu headers automatically
  def open_button(self):
    block = '<div class="menubutton-%(parity)s" style="right: %(lastpos)dpx;">' \
      % {'lastpos' : self.lastpos, 'parity' : self.parity}
    self.lastpos += self.step
    self.parity = "up" if self.parity == "down" else "down"
    return block